<template>
  <el-container class="index-con">
    <el-aside :class="showclass">
      <leftnav></leftnav>
    </el-aside>
    <el-container class="main-con">
      <el-header class="index-header" style="padding:0 0 0 0;">
        <navcon></navcon>
      </el-header>
      <el-main clss="index-main" style=" background-color:#ECF0F1;margin:0 0 0 0 ">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
// 导入组件
import navcon from '../components/navcon.vue'
import leftnav from '../components/leftnav.vue'
export default {
  name: 'homePage',
  data() {
    return {
   defaultHeight: {
      height: ""
    },
      showclass: 'asideshow',
      showtype: false,
    }
    
  },

  // 注册组件
  components: {
    navcon,
    leftnav
  },
methods: {
  //定义方法，获取高度减去头尾
  getHeight() {
    this.defaultHeight.height = window.innerHeight - 90 + "px";
  }
},
created() {
  //页面创建时执行一次getHeight进行赋值，顺道绑定resize事件
  window.addEventListener("resize", this.getHeight);
  this.getHeight();
},
  beforeUpdate() {},
  // 挂载前状态(里面是操作)
  beforeMount() {
    // 弹出登录成功
    // this.$message({
    //   message: '登录成功',
    //   type: 'success'
    // })
  }
}
</script>
<style >

.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.aside {
  width: 64px !important;
  height: 100%;
  background-color: #334157;
  margin: 0px;
}
.asideshow {
  width: 240px !important;
  height: 100%;
  background-color: #334157;
  margin: 0px;
}
.index-header {
  padding-left: -20px;

}

</style>
